<script type="text/javascript">
//读卡测试卡是否可读，可读则读出信息(余额，证件号，证件类型)
function readCard(){
	var flag=activeCPU()
	if(flag){
		flag=qzsmkocx.GetSmkNo();
	}
	var f;
	var text;
	if(flag){
		var citizenCardNo=qzsmkocx.GetRetValue().split(",")[0];
		$("input[name='citizenCardNoByAppOpen']").val(citizenCardNo);
		$.post("appOpenReg/queryCardInfoByCardNo",{"citizenCardNo":citizenCardNo},function(json){
		//	var adf=json[i].appFlag;
			var obj = json.cardAndCustInfo;
			if(!obj){
				alertMsg.warn("查不到该卡的信息！");
			}
			var paperNo = obj.paperNo;
			var paperType = obj.paperType;
			var paperName = obj.paperName;
			var customerName = obj.customerName;
			var cardPcode = obj.cardPcode;
			var cardPName = obj.cardPName;
			var physicTypeCode = obj.physicTypeCode;
			var typeName = obj.typeName;
			var cardPCodeAndName = "<option value='"+cardPcode+"'>"+cardPName+"</option>";
			var paperTypeAndName = "<option value='"+paperType+"'>"+paperName+"</option>";
			var physicTypeAndName = "<option value='"+physicTypeCode+"'>"+typeName+"</option>";
			$("#customerNameByAppOpen").val(customerName);
			$("#cardPNameByAppOpen").html(cardPCodeAndName);
			$("#paperTypeByAppOpen").html(paperTypeAndName);
			$("#cardPhysicTypeByAppOpen").html(physicTypeAndName);
			$("#paperNoByAppOpen").val(paperNo);	
			$("input[name='isRead']").val("1");
		},"json")
	}else{
		text="2";
		checkError(getError())	
		$("input[name='isRead']").val(text);
	}
}

function checkByCancelCard(obj){
	var isRead=$("input[name='isRead']").val();
//	var isRead = "1";
	if(isRead==""){
		alertMsg.warn('请先读卡')
		return false;
	}
	if(isRead=="2"){
		alertMsg.warn("您卡不可读，无法开通关闭应用！")
		return false;
	}
	return true;
}
</script>

<div class="pageHeader ">
	<form id="pagerForm" method="post" action="appOpenReg/getAppOpenInfo" class="pageForm required-validate"
		onsubmit="return validateCallback(this,getAppOpenInfo);">
		<input type="hidden" name="pageNum" value="" />
		<div class="searchBar">
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-6 col-sm-12">
					<p>
						<label>市民卡号：</label>
						<input class="" type="button" style="width:12%"	value="读卡" onclick="readCard()" /> 
						<input id="citizenCardNoByAppOpen" name="citizenCardNoByAppOpen" readonly="readonly" value="">
						<input name="isRead" type="hidden" value=""> 
					</p>
				</div>
				<div class="col-md-6 col-sm-12">
					<p>
						<label>持卡人：</label> 
						<input id="customerNameByAppOpen" name="customerNameByAppOpen" readonly="readonly"/>
					</p>
				</div>
			</div>
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-6 col-sm-12">
					<p>
						<label>卡产品：</label> 
						<select id="cardPNameByAppOpen" name="cardPNameByAppOpen" disabled="disabled"></select>
					</p>
				</div>
				<div class="col-md-6 col-sm-12">
					<p>
						<label>卡类型：</label>
						<select id="cardPhysicTypeByAppOpen" name="cardPhysicTypeByAppOpen" disabled="disabled"></select>
					</p>
				</div>
			</div>
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-6 col-sm-12">
					<p>
						<label>证件类型：</label> 
						<select id="paperTypeByAppOpen" name="paperTypeByAppOpen" disabled="disabled"></select>
					</p>
				</div>
				<div class="col-md-6 col-sm-12">
					<p>
						<label>证件号码：</label>
						<input name="paperNoByAppOpen" id="paperNoByAppOpen" readonly="readonly"/>
					</p>
				</div>
			</div>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit" onclick="return checkByCancelCard(this)">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
<!-- <div id="tableInfoByAppToOpen"> -->
	<fieldset>
	<legend>未开通应用</legend>
		<form id="pagerFormByOpenApp" method="post" action="appOpenReg/toOpenApp" class="pageForm required-validate"
		onsubmit="return validateCallback(this,navTabAjaxDone);">
			<input type="hidden" value="" name="citizenCardNoByOpenApp">
			<input type="hidden" value="" name="appFlagByOpenApp">
			<input type="hidden" value="" name="appTypeByOpenApp">
			<input type="hidden" value="" name="depositByOpenApp">
			<input type="hidden" value="" name="cardsnByOpenApp">
			<input type="hidden" value="" name="rechargeByOpenApp">
			<div id="tableInfoByAppToOpen">
			<table class="table" width="800" height="120">
				<thead>
					<tr align="center">
						<th width="3%">序号</th>
						<th width="10%">应用名称</th>
						<th width="10%">应用类型</th>
						<th width="10%">费用/押金</th>
						<th width="10%">充值金额</th>
						<th width="10%">开通/停用</th>
					</tr>
				</thead>
				<tbody id="tdInfoByAppToOpen">
					<tr>
						<td colspan='7' align='center'>请先读卡查询数据</td>
					</tr>
				</tbody>
			</table>
			</div>
		</form>
	</fieldset>
	<fieldset>
	<legend>已开通应用</legend>
		<form id="pagerFormByCloseApp" method="post" action="appOpenReg/toOpenApp" class="pageForm required-validate"
			onsubmit="return validateCallback(this,navTabAjaxDone);">
			<input type="hidden" value="" name="citizenCardNoByCloseApp">
			<input type="hidden" value="" name="appFlagByCloseApp">
			<input type="hidden" value="" name="appTypeByCloseApp">
			<input type="hidden" value="" name="cardsnByCloseApp">
			<input type="hidden" value="" name="depositByCloseApp">
			<input type="hidden" value="" name="blanceByCloseApp">
			<div id="tableInfoByAppToClose">
			<table class="table" width="800" height="120">
				<thead>
					<tr align="center">
						<th width="3%">序号</th>
						<th width="10%">应用名称</th>
						<th width="10%">应用类型</th>
						<th width="10%">费用/押金</th>
						<th width="10%">账户余额</th>
						<th width="10%">开通/停用</th>
					</tr>
				</thead>
				<tbody id="tdInfoByAppToClose">
					<tr>
						<td colspan='7' align='center'>请先读卡查询数据</td>
					</tr>
				</tbody>
			</table>
			</div>
		</form>
	</fieldset>
<!-- </div> -->
</div>

